package com.cf.main;

public class ProduceSimilarityMatrix implements Base{
		public double[][] produceSimilarityMatrix(int[][] preference) {
		double[][] similarityMatrix = new double[USERSIZE][USERSIZE];
		for (int i = 0; i < USERSIZE; i++) {
			for (int j = 0; j < USERSIZE; j++) {
				if (i == j) {
					//对角线，相似度为1
					similarityMatrix[i][j] = 1.0d;
				}
				else {//计算相似性
					similarityMatrix[i][j] = new ComputeSimilarity().computeSimilarity(preference[i], preference[j]);
				}			
			}
		}
		return similarityMatrix;
	}
}
